home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
utils
/
ted
/
tedtro6.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1994-10-02
|
6KB
|
215 lines
{
Coding & Editing by :
█▀▀▀▀▀▀█ █▀▀▀▀▀▀█ █▀▀▀▀▀▀█ █▀▀▀▀▀▀█ █▀▀▀▀▀█ █ █▀▀▀▀▀▀▀ █▀▀▀▀▀▀▀
█▀▀▀▀▀▀▀ █▀▀▀▀▀▀█ █▀▀▀▀▀█▀ █▀▀▀▀▀▀█ █ █ █ ▀▀▀▀▀▀▀█ █▀▀▀▀▀
█ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █ █ █ █ █
█ █ █ █ █ █ █ █▄▄▄▄▄█ █ ▄▄▄▄▄▄▄█ █▄▄▄▄▄▄▄
Programmed by Marcin Jaskowiak, aka Paradise, Lublin, Poland,
in Turbo Pascal 7.0.
This is FUQNWARE - if u like it, u must register it by sending
some money (u tell how much) to ME:) if not - u choose.
Read TED.DOC 4 more info.
Snail mail: Email:
Marcin Jaskowiak liksay@bachus.umcs.lublin.pl
Flat 114, 3 Zarnowiecka Str.
20-630 Lublin
Poland
Presents :
TED font editor SCROLLERS PACK 94
with :
EXAMPLE NR 6
}
PROGRAM TED_INTRO_NR6;
USES DOS,CRT;
CONST
SEGA000 : WORD = $A000;
SIZE = 10955; { SIZE OF ORYGINAL FONT FILE, NOT .OBJ BUT .TED!!! }
VAR
BITMAP : ARRAY [1..30,0..319] OF BYTE;
PALETTE : ARRAY [0..255,1..3] OF BYTE;
CHARS : ARRAY [' '..']'] OF POINTER;
CHARSDATA : ARRAY [' '..']',1..3] OF BYTE;
F : FILE;
B,ROW,NR : BYTE;
X,Y,I,J : INTEGER;
CH,K : CHAR;
TEKST : STRING;
SINUS : ARRAY [0..255] OF BYTE;
SINN : BYTE;
{───────────────────────────────────────────────────────────────────────────}
{$F+}
{$L FONT001F.OBJ}
PROCEDURE FDATA; EXTERNAL; { .TED FILE - FONT DATA }
{$L FONT001P.OBJ}
PROCEDURE PDATA; EXTERNAL; { .PAL FILE - PALETTE DATA }
{$F-}
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE CALCSIN;
VAR I : INTEGER;
BEGIN
FOR I := 0 TO 255 DO SINUS[I] := ROUND(SIN(15*I*PI/755)*24)+70;
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE INITVGA; ASSEMBLER; { INITIALIZE VGA CARD MODE 13H }
ASM
MOV AX,0013H
INT 10H
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE CLOSEVGA; ASSEMBLER; { CLOSE VGA MODE AND SET TEXT }
ASM
MOV AX,0003H
INT 10H
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE VSYNC; ASSEMBLER;
ASM
MOV DX,03DAH
@@1: IN AL,DX; TEST AL,8; JNZ @@1;
@@2: IN AL,DX; TEST AL,8; JZ @@2;
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE DRAWBITMAP(OFSiI: WORD); ASSEMBLER;
ASM
MOV DI,OFSiI
MOV ES,SEGA000
MOV SI,OFFSET BITMAP
MOV CX,4800
CLD
REP MOVSW
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE SCROLLBITMAP(VAR MAP); ASSEMBLER;
ASM
LDS SI,MAP
LES DI,MAP
INC SI
INC SI
MOV CX,4800
REP MOVSW
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE SETCOLOR(NR,R,G,B: BYTE); ASSEMBLER; { SET RGB VAL TO COLOR NR }
ASM
MOV DX,3C8H
MOV AL,NR
OUT DX,AL
INC DX
MOV AL,R
OUT DX,AL
MOV AL,G
OUT DX,AL
MOV AL,B
OUT DX,AL
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE LOADPAL; { LOAD .PAL FILE AND SET PALETTE }
BEGIN
MOVE(MEM[SEG(PDATA):OFS(PDATA)],PALETTE,768);
FOR B:=0 TO 255 DO
SETCOLOR(B,PALETTE[B,1],PALETTE[B,2],PALETTE[B,3]);
SETCOLOR(0,11,1,11);
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE LOADTED; { LOAD .TED FILE TO MEMORY }
VAR TX,TY: BYTE; CH: CHAR;
SEGM,OFST,EOFS: WORD;
BEGIN
SEGM:=SEG(FDATA);
OFST:=OFS(FDATA);
EOFS:=OFST+SIZE;
INC(OFST,20); { SKIP FILE HEADER }
WHILE NOT(OFST=EOFS) DO
BEGIN
MOVE(MEM[SEGM:OFST],CH,1); INC(OFST);
MOVE(MEM[SEGM:OFST],TX,1); INC(OFST);
MOVE(MEM[SEGM:OFST],TY,1); INC(OFST);
GETMEM(CHARS[CH],TX*TY);
CHARSDATA[CH,1]:=TX; CHARSDATA[CH,2]:=TY; CHARSDATA[CH,3]:=1;
MOVE(MEM[SEGM:OFST],CHARS[CH]^,TX*TY); INC(OFST,TX*TY);
END;
IF CHARSDATA[' ',3]<>1 THEN { IF NOT SPACE " " THEN CREATE IT }
BEGIN
TX:=CHARSDATA['A',1];
TY:=CHARSDATA['A',2];
GETMEM(CHARS[' '],TX*TY);
FILLCHAR(CHARS[' ']^,TX*TY,0);
CHARSDATA[' ',3]:=1;
CHARSDATA[' ',1]:=TX;
CHARSDATA[' ',2]:=TY;
END;
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE DONETED; { DEALLOCATE FONT MEMORY }
VAR CH: CHAR;
BEGIN
FOR CH:=' ' TO ']' DO
BEGIN
IF CHARSDATA[CH,3]=1 THEN
BEGIN
FREEMEM(CHARS[CH],CHARSDATA[CH,1]*CHARSDATA[CH,2]);
CHARSDATA[CH,3]:=0;
END;
END;
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE NEWROW(CH: CHAR; RO: BYTE; POS: INTEGER); { DRAW HORIZ LINE }
VAR TX,TY,IC: INTEGER;
BEGIN
IF CHARSDATA[CH,3]<>1 THEN EXIT; { EXIT IF NO CHAR IN FONT }
IC:=7;
FOR TY:=1 TO 30 DO BITMAP[TY,POS]:=0;
IF RO=CHARSDATA[CH,1]+1 THEN
FOR TY:=1 TO CHARSDATA[CH,2] DO BITMAP[TY+IC,POS]:=0 { SKIP ONE ROW }
ELSE
FOR TY:=1 TO CHARSDATA[CH,2] DO
BITMAP[TY+IC,POS]:=MEM[SEG(CHARS[CH]^):OFS(CHARS[CH]^)+(TY-1)*CHARSDATA[CH,1]+RO-1];
END;
{───────────────────────────────────────────────────────────────────────────}
PROCEDURE UPDATE; { NEW VALUES ? }
BEGIN
INC(ROW);
IF ROW>CHARSDATA[TEKST[NR],1]+1 THEN
BEGIN
ROW:=1;
INC(NR);
IF NR>LENGTH(TEKST) THEN NR:=1;
END;
END;
{───────────────────────────────────────────────────────────────────────────}
BEGIN
CALCSIN;
INITVGA;
LOADPAL;
LOADTED;
ROW:=1;
TEKST:=' OK DUDE! THERE IS A SMALL EXAMPLE HOW TO LINK .PAL AND .TED '+
' FILES INTO ONE EXE! I LIKE THIS FONT... BECUZ ITS SMALL AND PRETTY :] '+
' U CAN USE PKLITE OR LZEXE TO SMALL IT!!! ............. ';
NR:=1;
SINN:=0;
FILLCHAR(BITMAP,SIZEOF(BITMAP),0);
REPEAT
SCROLLBITMAP(BITMAP);
UPDATE;
NEWROW(TEKST[NR],ROW,318);
UPDATE;
NEWROW(TEKST[NR],ROW,319);
DRAWBITMAP(SINUS[SINN]*320);
VSYNC;
INC(SINN); IF SINN=101 THEN SINN:=0;
UNTIL KEYPRESSED;
DONETED;
CLOSEVGA;
END.